package com.heima.test6;

import java.util.Random;

public class Code {
    public static String getLoginCode(){
        String code="";
        Random r=new Random();
        for (int i = 0; i < 4; i++) {
            switch (r.nextInt(3)){
                case 0:
                    code+=r.nextInt(10);
                    break;
                case 1:
                    code+=(char)(r.nextInt(26)+65);
                    break;
                case 2:
                    code+=(char)(r.nextInt(26)+97);
                    break;
            }
        }
        return code;
    }
}
